<?php 
	$product = $this->product;
	
?>

<div class="block">
	<h3 class="title">Chi tiết sản phẩm</h3>
	<div id="detail-product" class="content" >
		<div class="basic-info clearfix">
			<div class="box-image clearfix">
			<div class='big-image'>
				<img id="img-zoom" src="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$product['product_image']?>" data-zoom-image="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$product['product_image']?>"/>
			</div>
			 		
			<div id="gallery" class='jcarousel clearfix'> 
			 		<ul>
                        <li>
	                        <a href="#" data-image="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$product['product_image']?>" data-zoom-image="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$product['product_image']?>"> 
								<img id="img-zoom" src="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/thumbs/'.$product['product_image']?>" /> 
							</a> 
                        </li>
                        
                        <?php 
			            	$images = $product->findDependentRowset('Application_Model_DbTable_ProductImage');
			            	if(count($images)):
			            		foreach ($images as $image):	          
					            ?><li>
					            	<a href="#" data-image="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$image['product_image_name']?>" data-zoom-image="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/400x400/'.$image['product_image_name']?>"> 
										<img id="img-zoom" src="<?php echo PUBLIC_RESOURCE.'/uploads/images/products/thumbs/'.$image['product_image_name']?>" /> 
									</a> 
									</li>
	           			<?php endforeach;	endif;	  ?>   
                        
                    </ul>
		           	 <a href="#" class="jcarousel-control-prev">&lsaquo;</a>
	                <a href="#" class="jcarousel-control-next">&rsaquo;</a>
			</div><!--end gallery -->
		
			<script>
			
				
				$(document).ready(function(){
				
					// var w_border = $('.big-image').width();;
					// var w = $('.big-image #img-zoom').width();
					// var w_custom = (w_border-w)/2;
					// $('.big-image #img-zoom').css('left',w_custom);
					
						
					
					
					// $('#gallery a').click(function(){
						// var w_border = $('.big-image').width();;
						// var w = $('.big-image #img-zoom').width();
						// var w_custom = (w_border-w)/2;
						
						
							// $('.big-image #img-zoom').css('left',w_custom);
						
					
					// })
					
					$("#img-zoom").elevateZoom({	
						scrollZoom: false,												
						responsive: true,												
						gallery: 'gallery', 
						cursor: 'pointer', 
						galleryActiveClass: "active", 
						imageCrossfade: true, 
						//loadingIcon: "js/fancybox/fancybox_loading@2x.gif",
						//zoomWindowOffetx: 7,
						//zoomWindowOffety: -3,
						//zoomWindowWidth: 475,
						
					}); 
					
					//pass the images to Fancybox 
					$("#img-zoom").on("click", function(e) {  
					  var ez =   $("#img-zoom").data("elevateZoom");
						ez.closeAll();
						$.fancybox(ez.getGalleryList());
					  return false;
					}); 
					
					
				})
			</script>
				
			</div><!--  End box image -->
			<div class="box-basic-info">

				<div class="product-block-info">
					<h3><?php echo $product['product_name']?></h3>
				</div>
				<div class="product-block-info">
					<h4>Hãng sản xuất: <?php echo $product->findParentRow('Application_Model_DbTable_Manufacture')->manufacture_name?></h4>
				</div>
				<div class="product-block-info">
					<h4 class="price">Price: <?php echo number_format($product['product_price'])?> vnd</h4>
				</div>

				<div class="product-block-info">
					<div class="box-order clearfix">
						<form id="frm-order" method="post" action="<?php echo $this->baseUrl('/order/insert/lang/'.LANG)?>">
							<input type="hidden" value="<?php echo $product['product_id']?>" name='id' />
							<label>Chọn số lượng</label> 
							<select name='qty'>
								<?php 
									for($i=1;$i<=10;$i++){
										echo "<option value=$i>$i</option>";		
									}
								?>
								
							</select> 
							
							<!-- <input type="hidden" value="1" name='qty' />-->
							<span class="image-submit">Mua online</span>

							<script>
								$(document).ready(function(){
									$("#frm-order .image-submit").click(function(){
										$("#frm-order").submit();
									});
								});
							</script>
						</form>
					</div>
				</div>
			</div>
		</div>
        <div class='line'></div>
		<div class="detail-info">
			<div class="tab-list">
				<ul>
					<li><a href="#detail" class="active"><h4>Thông số kỹ thuật</h4></a></li>
					<li><a href="#describe"><h4>Đánh giá chi tiết</h4></a></li>
				</ul>
				<div class="clearb"></div>
			</div>

			<div id="detail" class="tab-item">
				<table>
					<tr>
						<td>Vi xử lý</td>
						<td><?php echo $product['product_cpu']?></td>
					</tr>
					<tr>
						<td>Bộ nhớ trong</td>
						<td><?php echo $product['product_hdd']?></td>
					</tr>
					<tr>
						<td>Ram</td>
						<td><?php echo $product['product_ram']?></td>
					</tr>
					<tr>
						<td>card màn hình</td>
						<td><?php echo $product['product_video_card']?></td>
					</tr>
					<tr>
						<td>Màn hình</td>
						<td><?php echo $product['product_display']?></td>
					</tr>
					<tr>
						<td>Hệ điều hành</td>
						<td><?php echo $product['product_operator']?></td>
					</tr>
					<tr>
						<td>Camera </td>
						<td><?php echo $product['product_camera']?></td>
					</tr>
					<tr>
						<td>Camera phụ</td>
						<td><?php echo $product['product_camera_sub']?></td>
					</tr>
					<tr>
						<td>Kết nối</td>
						<td><?php echo $product['product_connect']?></td>
					</tr>
					<tr>
						<td>Tai nghe</td>
						<td><?php echo $product['product_ear_plugin']?></td>
					</tr>
					<tr>
						<td>Pin</td>
						<td><?php echo $product['product_battery']?></td>
					</tr>
					<tr>
						<td>Cảm ưng</td>
						<td><?php echo $product['product_touch']?></td>
					</tr>
				</table>
			</div>
			<div id="describe" class="tab-item">
				<?php echo $product['product_describe_vi']?>
			</div>
		</div>
		
		<!-- facebook comment -->
		<div class='facebook'>
			<div class="fb-comments" data-href="<?php echo FACEBOOK_URL.$_SERVER["REQUEST_URI"];?>" data-width="720" data-numposts="5" data-colorscheme="light"></div>
		</div>
	</div><!-- end content -->

</div>